import { h } from 'vue';

const TableColumn = {
  name: 'TableColumn',
  setup() {
    const editRow = (id) => {
      // 处理编辑操作
    };

    const delRow = (id) => {
      // 处理删除操作
    };

    return () => (
      <el-table-column label="操作">
        {{
          default: ({ row }) => (
            <>
              <el-button onClick={() => editRow(row.id)} type="success">修改</el-button>
              <el-popconfirm title="确认删除吗？" onConfirm={() => delRow(row.id)}>
                {{
                  reference: () => <el-button type="danger">删除</el-button>
                }}
              </el-popconfirm>
            </>
          )
        }}
      </el-table-column>
    );
  },
};

export default TableColumn;